package lvtu.opencv.util;

import java.io.Serializable;

import com.qunar.upd.app.client.QupdClient;
import com.qunar.upd.app.client.QupdClient.ResizeMode;

public class UploadedPic implements Serializable {

	private static final long serialVersionUID = 1046980181029886484L;
	public static final String HOTS_URL = "http://img.qunarzz.com";
	public static final String HOTS_URL_CDN = "http://img1.qunarzz.com";
	public static final String HOTS_URL_HEADSHOT = "http://headshot.user.qunar.com";
//	public static final int RANDOM = 6;
//	public static final int RANDOM_DIVID = 9;
	public static final int OVER_HIGHT = 5000;
	public static final double [] RANDOM_VALUE = {1.4,1.6,1.2,1.5,1.5,1.7,1.6,1.5,1.6,1.8,1.6};
	private String ret;
	private String src_file;
	private String img;

	public String getRet() {
		return ret;
	}

	public void setRet(String ret) {
		this.ret = ret;
	}

	public String getSrc_file() {
		return src_file;
	}

	public void setSrc_file(String src_file) {
		this.src_file = src_file;
	}

	public String getImg() {
		return HOTS_URL + img;
	}

	public void setImg(String img) {
		this.img = img;
	}
	public String getImg1() {
		return HOTS_URL_CDN + img;
	}
	public String getHeadImg() {
		return HOTS_URL_HEADSHOT + img;
	}
	/**
	 * 直接服务 + resize 缩放
	 * 
	 * @author waynechen
	 * @param size
	 *            如: "100x200"
	 * @return
	 */
	public String getWaterImagResizeURL(String size) {
		size = size.replace("*", "x").replace("X", "x");
		return HOTS_URL + QupdClient.genImgURI(img, size, ResizeMode.RESIZE);
	}

	/**
	 * 直接服务 + crop 缩放
	 * 
	 * @author waynechen
	 * @param size
	 *            如: "100x200"
	 * @return
	 */
	public String getWaterImagCropURL(String size) {
		size = size.replace("*", "x").replace("X", "x");
		return HOTS_URL + QupdClient.genImgURI(img, size, ResizeMode.CROP);
	}

}

// {"data":[
//
// {"ret":true,"src_file":"22.jpg","water_img":"/wugc/p180/201111/28/4448ddcd98f820411b77bf3d.wm.jpg"},
// {"ret":true,"src_file":"32.jpg","water_img":"/wugc/p180/201111/28/eda00f148f1f06861b77bf3d.wm.jpg"}
//
// ],"ret":true}